<template>
    <div>
        <el-form :model="userForm" status-icon label-width="100px" class="demo-ruleForm">
            <el-form-item label="密码" >
                <el-input  v-model="userForm.name" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="确认密码" >
                <el-input  v-model="userForm.checkPass" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="年龄" >
                <el-input v-model="userForm.age"></el-input>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="submitForm('userForm')">保存修改</el-button>
                <el-button @click="resetForm('userForm')">重置</el-button>
            </el-form-item>
        </el-form>
    </div>
</template>

<script>
  export default {
    data() {
      return {
          username:"",
          userForm: {},
      };
    },
    created() {
        this.showInfo()
    },
    methods: {
        async showInfo() {
            this.username = localStorage.getItem('ms_username')
            const res = await this.$http.get("/user/searchUserByName", {
                params: {
                    name : this.username
                }
            })
            this.userForm = res.data[0]
            console.log("this.userForm", this.userForm)
        },
        submitForm(formName) {

        },
        resetForm(formName) {

        }
    }
  }
</script>

<style>

</style>